package com.bw.zg3park2212.apply

import androidx.lifecycle.MutableLiveData
import com.bw.base.entity.OrderEntity
import com.bw.base.entity.ParkApplyEntity
import com.bw.base.entity.RepairApplyEntity
import com.bw.base.entity.RepairEntity
import com.bw.base.mvvm.BaseViewModel
import com.bw.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class ApplyViewModel  @Inject constructor(val apiService: ApiService): BaseViewModel() {
    var parkapplySuccse=MutableLiveData<ParkApplyEntity>()
    fun parkApply(areaId:Int){
        httpRequst(
            {apiService.getparkapply(areaId)},
            parkapplySuccse::postValue
        )
    }
    var repairapplySuccse=MutableLiveData<RepairApplyEntity>()
    fun repairApply(){
        httpRequst(
            {apiService.getrepairapply()},
            repairapplySuccse::postValue
        )
    }
    val repairSuccse=MutableLiveData<RepairEntity>()
    fun repair(){
        httpRequst(
            {apiService.getRepair()},
            repairSuccse::postValue
        )
    }
    var orderSucsse=MutableLiveData<OrderEntity>()
    fun getorder(){
        httpRequst(
            {apiService.getorder()},
            orderSucsse::postValue)
    }
}